Usually if something needs to be coded, it means that something is not suitable for transmission. There are a variety of reasons, such as size too large to contain private data, and for URLs, the reason for encoding is because some characters in the
Kankan OriginalThis format is required when sending data in the background with PHP.private void Sendjson () { Initializing a custom handlerCashhandler handler = new Cashhandler (this);Request the primary address, written in the custom application,
html, JavaScript, URL special character escapes in the actual programming are useful, some people on the use of special character escapes is not very clear, the following on the escape of Html,javascript,url special characters to do a description
Solution to Chinese garbled characters in URL addresses, Chinese garbled characters in url addresses
Introduction: In Restful service design, users often encounter the need to use Chinese as a parameter in the URL address. In this case, generally,
Solution to Chinese garbled characters in URL addresses: url Chinese
Solution to Chinese garbled characters in URL addresses
Introduction: In Restful service design, users often encounter the need to use Chinese as a parameter in the URL address. In
Spaces-%20
"-%22
#-%23
%-%25
&-%26
(-%28
)-%29
+-%2B
,-%2c
/-%2F
:-%3a
; -%3b
=-%3d
>-%3e
? -%3f
@-%40
\-%5C
| -%7c
Passing special characters such as a plus sign in a URL
Some characters in the URL are escaped, such as the space is encoded into
DocumentWhen url is used for parameter transfer, some parameters or URL addresses with Chinese names are often passed, and conversion errors may occur during backend processing. In some transfer pages, GB2312 is used, and UTF8 is used on the
URL encoding conversion, escape () encodeURI () encodeURIComponent ()
Escape () method:
The specified string is encoded using the ISO Latin character set. All space characters, punctuation marks, special characters, and other non-ASCII characters
Principles of URL escape characters
If the form action is list. JSF? Act = Go & State = 5
Then, request. getparameter can be used to obtain the values of act and state.
If your intention is the act = 'go & State = 5' string, You must escape &
We can tell that escape () escapes all incoming strings in addition to ASCII letters, numbers, and specific symbols, so it is best not to use this method if you want to encode the URL. encodeURI () is used to encode the entire URI because the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.